<?php
$url = '?md=' . MvcReg::$_moduleName . '&cl=' . MvcReg::$_controllerName . '&at=' . str_replace('add', '', MvcReg::$_actionName) . 'update';

?>
<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <?php include_once MvcReg::$_moduleName . '/views/layout/head.php'; ?>
</head>
<body>
<?php include_once MvcReg::$_moduleName . '/views/layout/woody-prompt.php'; ?>
<?php include_once MvcReg::$_moduleName . '/views/layout/header.php'; ?>
<div id="main">
    <div class="container-fluid">
        <div class="row">
            <div class="col-md-2">
                <?php include_once MvcReg::$_moduleName . '/views/layout/left_menu.php'; ?>
            </div>
            <div class="col-md-10">
                <div class="right-content">
                    <h3>
                        <ol class="breadcrumb">
                            <li><a href="?md=company&cl=company&at=changepwd"><i class="fa fa-dashboard"></i><?php echo $menu["breadcrumb_current"] ?></a></li>
                        </ol>
                    </h3>
                    <br>
                    <form class="form-horizontal" action="<?php echo $url?>"
                           autocomplete="off" onsubmit="return check();" method="post">
                        <div class="form-group">
                            <label for="cname" class="col-md-2 control-label">
                                <i>*</i>原始密码：
                            </label>
                            <div class="col-md-6">
                                <input type="password" name="oldps" value="" class="form-control " placeholder="" required/>
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="title" class="col-md-2 control-label">
                                <i>*</i>新密码：
                            </label>
                            <div class="col-md-6">
                                <input type="password" name="newps" value="" class="form-control " placeholder="" required>
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="addtime" class="col-md-2 control-label">
                                <i>*</i>确认新密码：
                            </label>
                            <div class="col-md-6">
                                <input type="password" name="conps" value="" class="form-control " placeholder="" required>
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="stacode" class="col-md-2 control-label">
                            </label>
                            <div class="col-md-4">
                                <button type="submit" class="btn btn-success">保存</button>
                            </div>
                            <span class="col-md-6"></span>
                        </div>
                        <input type="hidden" id="page" name="page" value="<?php echo $page?>"/>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<?php include_once MvcReg::$_moduleName . '/views/layout/footer.php'; ?>
</body>
<script>
    function check(){
        var oldps = $("input[name='oldps']").val();
        var newps = $("input[name='newps']").val();
        var conps = $("input[name='conps']").val();
        if(oldps==""){
            alert("原始密码不能为空！");
            return false;
        }
        if(newps==""||conps==""){
            alert("新密码不能为空！");
            return false;
        }
        if(newps!=conps){
            alert("两次密码不一致！");
            return false;
        }
    }
</script>

</html>
